/*
*    Phantom v2.0 GUI Automation Software
*    Copyright (C) 2009  John C. Van Arsdall (john@phantomtest.com)
*
*    This program is free software; you can redistribute it and/or modify
*    it under the terms of the GNU General Public License as published by
*    the Free Software Foundation; either version 2 of the License, or
*    (at your option) any later version.
*
*    This program is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License along
*    with this program; if not, write to the Free Software Foundation, Inc.,
*    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
// Operator.h: interface for the COperator class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_OPERATOR_H__71043D8F_001C_4695_B51E_6B52483B7093__INCLUDED_)
#define AFX_OPERATOR_H__71043D8F_001C_4695_B51E_6B52483B7093__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "ssi_defines.h"
#include "ssi_string.h"
#include "ssi_variable.h"	// Added by ClassView
#include "ssi_status.h"	// Added by ClassView
#include "ssi_internalerrors.h"

#define EQUAL_OP    '='
#define GREATER_OP  '>'
#define LESS_OP     '<'
#define NOT_OP      '!'

#define PLUS_OP     '+'
#define MINUS_OP    '-'
#define DIVIDE_OP   '/'
#define MULTIPLY_OP '*'
#define POWER_OP    '^'
#define MODULOUS_OP '%'
#define DOT_OP			'.'
#define AND_OP			'&'
#define OR_OP			  '|'

class SSI_SCRIPTDLL_API COperator  
{
public:
	CVariable Result;
	//CStatus Evaluate();
	CVariable GetRight();
	CVariable GetLeft();
	CStatus SetRight(CVariable &Var);
	CStatus SetLeft(CVariable &Var);
  COperator& operator =(COperator &Other);
	static SSI_BOOL TestForOperator(const String& Input);
  static SSI_INT64 StrToType(const String& Input);
	static String TypeToStr(SSI_INT64 In);
	void ClearType();
	void SetType(SSI_INT64 NewType);
	COperator();
	virtual ~COperator();
	CVariable Right_Var;
	CVariable Left_Var;
  SSI_INT64 Type;

protected:

public:
	void SetMode(SSI_BYTE NewMode);
	static SSI_BYTE GetMode(const String& Input);
	SSI_BYTE Mode;
	CStatus AddType(SSI_INT64 NewType);
};

#endif // !defined(AFX_OPERATOR_H__71043D8F_001C_4695_B51E_6B52483B7093__INCLUDED_)



